package cn.com.zzl.po;

/**
 * Description：学生实体类（为ObjectsTest做准备）
 * Created by 永竹(朱正磊) on 2017-08-21 9:51.
 */
public class Student {

	private String name;

	private Integer age;

	public Student() {

	}

	public Student(String name, Integer age) {
		this.name = name;
		this.age = age;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public int hashCode() {
		return this.getAge();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		Student student = (Student) obj;
		if (this.name == null) {
			if (student.name != null) {
				return false;
			}
		} else if (!this.name.equals(student.name)) {
			return false;
		}
		return true;
	}

}
